<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\BrokerMobile
 *
 * @mixin \Eloquent
 * @property int $id
 * @property string|null $mobile
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property int|null $is_bind 0未绑定  1已绑定
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\BrokerMobile whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\BrokerMobile whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\BrokerMobile whereIsBind($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\BrokerMobile whereMobile($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\BrokerMobile whereUpdatedAt($value)
 */
class BrokerMobile extends Model
{
    protected $table='broker_mobile';
    public static function getSelectOptions()
    {
        $options = \DB::table('broker_mobile')->select('id','mobile as text','is_bind')->get();
        $selectOption = [];
        foreach ($options as $option){
           if( $option->is_bind==1){
               $value='已绑定';
           }else{
               $value='未绑定';
           }
            $selectOption[$option->id] = $option->text.' '.$value;
        }
        return $selectOption;
    }

}
